<?php
    include('header.php');
    include('submenu.php');
    
    $sql = "SELECT cc_id,cc_code,cc_name FROM customer_company ORDER BY cc_code";
    $result = $db->Execute($sql);
    $company_list = '';
    while (!$result->EOF)
    {
        $company_list .=<<<packing_list
            <option value="{$result->fields['cc_id']}">{$result->fields['cc_code']} ({$result->fields['cc_name']})</option>
packing_list;
        
        $result->MoveNext();
    }
    $result->Close();
?>
    <div class="grid_18" id="contents">
        
        <div id="contents_">
            <h2 class="page_title">Add Customer</h2>
            <form action="?m=customer&s=customer_add_query" method="post" target="ajax_iframe" id="customer_form">
            <div id="about_us_company_msg_1_en" class="form_field">
                <p>Company : </p>
                <select name="cc_id" class="select input"><?php echo $company_list; ?></select>
            </div>
            <div id="about_us_company_msg_1_en" class="form_field">
                <p>Contact no.: </p>
                <input type="text" name="c_no" class="input large" />
            </div>
            <div id="about_us_company_msg_1_en" class="form_field">
                <p>Name : </p>
                <input type="text" name="c_name" class="input large" />
            </div>
            <div id="about_us_company_msg_1_en" class="form_field">
                <p>Department : </p>
                <input type="text" name="c_department" class="input large" />
            </div>
            <div id="about_us_company_msg_1_en" class="form_field">
                <p>Position : </p>
                <input type="text" name="c_position" class="input large" />
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>Tel : </p>
                <input type="text" name="c_tel" class="input large" />
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>Fax : </p>
                <input type="text" name="c_fax" class="input large" />
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>Mobile : </p>
                <input type="text" name="c_mobile" class="input large" />
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>E-mail : </p>
                <input type="text" name="c_email" class="input large" />
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>Data 1 : </p>
                <textarea class="styled_textarea large height120" name="c_data1"></textarea>
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>Data 2 : </p>
                <textarea class="styled_textarea large height120" name="c_data2"></textarea>
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>Data 3 : </p>
                <textarea class="styled_textarea large height120" name="c_data3"></textarea>
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>Data 4 : </p>
                <textarea class="styled_textarea large height120" name="c_data4"></textarea>
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>Data 5 : </p>
                <textarea class="styled_textarea large height120" name="c_data5"></textarea>
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>Data 6 : </p>
                <textarea class="styled_textarea large height120" name="c_data6"></textarea>
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>Customer Type / Contact Type :</p>
                <input type="checkbox" name="c_web" class="checkbox" /> Web Development<br />
                <input type="checkbox" name="c_interactive" class="checkbox" /> Interactive Presentation<br />
                <input type="checkbox" name="c_video" class="checkbox" /> Video Presentation<br />
                <input type="checkbox" name="c_emag" class="checkbox" /> E-Magazine Service<br />
                <input type="checkbox" name="c_annual" class="checkbox" /> Annual Report<br />
                <input type="checkbox" name="c_printing" class="checkbox" /> Printing Service<br />
                <input type="checkbox" name="c_photography" class="checkbox" /> Digital Photography<br />
                <input type="checkbox" name="c_copywriter" class="checkbox" /> Copywriter & Translation Service<br />
                <input type="checkbox" name="c_dvd" class="checkbox" /> CD/DVD Production
            </div>
            
            <div id="about_us_company_msg_2_en" class="form_field">
                <button class="button" id="ajax_button">SAVE</button>
                <img src="images/ajax-loader.gif" id="ajax_loader" class="display_none" />
            </div>
            </form>
            <iframe name="ajax_iframe" class="display_none"></iframe>
        </div>
        <!--<p id="xxxxxx">dddddddddddd</p>-->
    </div><!-- end .grid_18 -->
    <div class="clear">&nbsp;</div>
<?php
    include('footer.php');
?>
<script>
    $(document).ready(function(){
        $('#ajax_button').live('click',function(){
            $('#ajax_loader').css('display','inline');
        });
        
        //$('#xxxxxx').live('click',function(){
        //    var str = $('#customer_form').serialize();
        //    alert(str);
        //});
    });
</script>